// 获取一级分类列表数据
import httpInstance from "@/utils/http";
export const getCategoryAPI = (id) =>
  httpInstance({
    url: "/category",
    params: {
      id,
    },
  });

// 获取二级分类列表数据
export const getCategoryFilterAPI = (id) =>
  httpInstance({
    url: "/category/sub/filter",
    params: {
      id,
    },
  });

/**
 * 获取导航数据
 * 请求参数有id，page页码，pageSize每页数量
 * sortField 排序字段，有publishTime/orderNum/evaluateNum
 */
export const getSubCategoryAPI = (data) =>
  httpInstance({
    url: "/category/goods/temporary",
    method: "post",
    data,
  });
